Skip to content

Add unit tests for PrepayCreditsSnapshot#301

Open
marcoagonzales007 wants to merge 1 commit into
CCI-MOC:mainfrom
marcoagonzales007:add-prepay-credits-snapshot-tests
Open

Add unit tests for PrepayCreditsSnapshot#301
marcoagonzales007 wants to merge 1 commit into
CCI-MOC:mainfrom
marcoagonzales007:add-prepay-credits-snapshot-tests

Conversation

@marcoagonzales007

Copy link
Copy Markdown
Contributor

Part of #185

Adds unit tests for PrepayCreditsSnapshot bringing the coverage from 85% to 100%.

Tests added:

test_output_path — verifies the output filename is correctly formatted
test_output_s3_key — verifies the S3 path is correctly formatted
test_output_s3_archive_key — verifies the S3 archive path is correctly formatted
test_prepare — verifies that prepare correctly filters credits to only managed groups for the invoice month

== "Invoices/2025-01/Archive/NERC_Prepaid_Group-Credits-2025-01 2025-01-01T00:00:00.csv"
)

def test_prepare(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just omit this test, and edit test_get_credit_snapshot() so that it calls _prepare(). This test doesn't really test anything new that the current tests doesn't

@QuanMPhm QuanMPhm requested review from knikolla and naved001 June 11, 2026 17:16
@QuanMPhm

QuanMPhm commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@knikolla @naved001 This looks good to me

@marcoagonzales007 Make sure to squash your commits in this PR and update the commit message

Part of CCI-MOC#185

Adds unit tests for PrepayCreditsSnapshot bringing the coverage from 85% to 100%.

Tests added:
- test_output_path: verifies the output filename is correctly formatted
- test_output_s3_key: verifies the S3 path is correctly formatted
- test_output_s3_archive_key: verifies the S3 archive path is correctly formatted
- test_get_credit_snapshot: verifies that prepare correctly filters credits to only managed groups for the invoice month
@marcoagonzales007 marcoagonzales007 force-pushed the add-prepay-credits-snapshot-tests branch from fcdfe47 to 8bcfa64 Compare June 15, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants